package com.youkeyi.ddy.cloud.common.api.application.business.storage.category;

import com.youkeyi.ddy.cloud.common.api.application.business.storage.category.dto.BusinessCategoryListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.business.storage.category.param.BusinessCategoryCreateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.storage.category.param.BusinessCategoryDeleteCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.storage.category.param.BusinessCategoryListCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.storage.category.param.BusinessCategoryUpdateCloudParam;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 商品分类
 *
 * @Serveror liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【BUSINESS】Goods Category Management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-BUSINESS", fallback = BusinessCategoryCloudServiceFallback.class)
@RequestMapping("/business/goods/category")
public interface BusinessCategoryCloudService {

    // 查询商品分类列表
    @ApiOperation(value = "Query Goods Category List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.storage.category.BusinessCategoryCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = BusinessCategoryListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Goods Category List", dataType = "BusinessCategoryListCloudParam", dataTypeClass = BusinessCategoryListCloudParam.class),
    })
    @GetMapping
    public abstract BusinessCategoryListCloudDto list(BusinessCategoryListCloudParam param);


    // 创建商品分类
    @ApiOperation(value = "Create Goods Category", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.storage.category.BusinessCategoryCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create Goods Category", dataType = "BusinessCategoryCreateCloudParam", dataTypeClass = BusinessCategoryCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody BusinessCategoryCreateCloudParam param);


    // 编辑商品分类
    @ApiOperation(value = "Update Goods Category", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.storage.category.BusinessCategoryCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update Goods Category", dataType = "BusinessCategoryUpdateCloudParam", dataTypeClass = BusinessCategoryUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody BusinessCategoryUpdateCloudParam param);


    // 删除商品分类
    @ApiOperation(value = "Delete Goods Category", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.storage.category.BusinessCategoryCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete Goods Category", dataType = "BusinessCategoryDeleteCloudParam", dataTypeClass = BusinessCategoryDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(BusinessCategoryDeleteCloudParam param);

}
